package com.joysuch.wwyt.bp.enums;

/**
 * @Author ZhangDong
 * @Date 2020/8/5 11:24
 */
public enum TargetDutyTypes {

    COMPILE((byte) 0, "编制中"),
    WAIT_AUDIT((byte) 1, "等待审核"),
    AUDIT_FAIL((byte) 2, "审核未通过"),
    AUDIT_PASS((byte) 3, "审核通过"),
    EXAMINE_DONE((byte) 4, "已考核"),
    EXAMINE_UNDO((byte) 5, "未考核"),
    EXAMINE_DOING((byte) 6, "考核中");

    private Byte index;
    private String type;

    TargetDutyTypes(Byte index, String type) {
        this.index = index;
        this.type = type;
    }

    public String getType() {
        return this.type;
    }

    public Byte getIndex() {
        return this.index;
    }

    public static String getTypeByIndex(Byte index) {
        TargetDutyTypes[] values = TargetDutyTypes.values();
        for (TargetDutyTypes value : values) {
            if (value.index.equals(index)) {
                return value.type;
            }
        }
        return null;
    }

    public static Byte getIndexByType(String type) {
        TargetDutyTypes[] values = TargetDutyTypes.values();
        for (TargetDutyTypes value : values) {
            if (value.type.equals(type)) {
                return value.index;
            }
        }
        return null;
    }


}
